"use strict";
import * as q from 'q';
import {EventEmitter} from 'events';
import {BaseCom} from './BaseCom';

class BaseController extends EventEmitter {
    public comPort: BaseCom;
    constructor() {
        super();
    }
    
    /** 指示器,是否正在测量中 */
    protected _working: boolean = false;
    
    /** 注销com口已经各类绑定事件 */
    public dispose(): void {
        this.removeAllListeners();
        this.comPort.close();
        this.comPort.port.removeAllListeners();
    }

    public get isWorking() {
        return this._working;
    }
}

export {BaseController}